Skip to content

Conversation

@lucaswoj
Copy link
Contributor

fix #6563

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@lucaswoj
Copy link
Contributor Author

lucaswoj commented Nov 14, 2025

Screenshot 2025-11-14 at 3 47 01 PM

I have determined that the translatedPolygon (in red above) being passed to projectQueryGeometry is correct but the returned value of transformedPolygon (in blue above) is incorrect. https://github.com/maplibre/maplibre-gl-js/blob/main/src/style/style_layer/circle_style_layer.ts#L72

Internally, it appears that we're passing some bad values to getElevation (e.g. large negative X coordinates) and getting bad values back (e.g. 0 when the elevation should be ~1000).

I wonder if we're getting tripped up on the mismatch between the maxzoom of the circle tiles vs the terrain tiles?

@lucaswoj
Copy link
Contributor Author

Before #5599 we effectively returned every circle feature in every loaded tile, so running queryRenderedFeatures on the whole viewport seemed to work. If you had run it on a specific rectangle within the viewport, you would've noticed that it wasn't returning the expected results. That's all to say, the fix goes much deeper than #5599, and touches on some areas where the 3D terrain implementation seems to have never worked properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terrain can cause queryRenderedFeatures to not return all results at high zoom levels

1 participant